/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jogopoo.Engine;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import javazoom.jl.player.Player;

import java.io.File;
import jogopoo.Interface.Janela;

/**
 *Classe que executa a musica.
 * @author pererabass
 */
public class EngineMusica extends Thread{

    public EngineMusica(Janela janela){
        String nomeArquivo = "sons/trololoChiptune.mp3";
        arquivo = new File(nomeArquivo);
        this.janela = janela;
    }
    @Override
    public void run() {
        try {

            while (true) {
              FileInputStream  fis = new FileInputStream(arquivo);
              BufferedInputStream  bis = new BufferedInputStream(fis);
                this.player = new Player(bis);
                this.player.play();
                
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

private File arquivo;
private Player player;
private Janela janela;
}
